package com.dmjj.util.receive;

import com.alibaba.fastjson.JSON;
import com.dmjj.log.pojo.SysLog;
import com.dmjj.log.service.SysLogService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class Receiver {

    @Autowired
    private SysLogService sysLogService;
    @RabbitListener(queues ="testqueue" )
    public String receiveMessage(String message){
        SysLog sysLog=  JSON.parseObject(message,SysLog.class);
        int i = sysLogService.saveLogger(sysLog);
        return null;
    }

}
